<?php

namespace app\common\validate\Subject;

// 引入tp的验证器
use think\Validate;

// 课程分类验证器
class Category extends Validate
{
    // 验证规则
    protected $rule = [
        'name' => ['require'],
        'weight' => ['require', 'number'],
    ];

    // 错误提示信息
    protected $message = [
        'name.require' => '分类名称必填',
        'weight.require' => '分类权重必填',
        'weight.number' => '分类权重类型错误',
    ];
}